package com.scorpio.framework.netrequest;


import com.alibaba.fastjson.JSONObject;
import com.scorpio.common.utils.http.HttpUtils;
import com.scorpio.common.utils.http.Request;
import com.scorpio.framework.netrequest.dto.BaseModel;

public class NetServerRequest {
    public static <T extends BaseModel> BaseModel send(Class<T> tClass, Request request) {
        String bodyStr = HttpUtils.request(request);
        BaseModel model = JSONObject.parseObject(bodyStr, tClass);
        int code = model.getCode();
        if (code == UrlAddress.SUCCEED_CODE) {

        } else if (code == UrlAddress.FAILURE_CODE) {

        } else if (code == UrlAddress.PAST_CODE) {

        } else {

        }
        return model;
    }
}
